<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-商品列表">
</@frame.head>
<script type="text/javascript" src="${contextPath}/resources/js/tool/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/comm.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/select/py.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/select/Popt.js"></script>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/select/jquery.searchableSelect.css" />
<script type="text/javascript">
var path="${contextPath}";
</script>
<style>
/*后台tab菜单*/
.admin_tab{border-bottom:1px solid #ddd;height:40px;margin-top:10px}
.admin_tab a{float:left;padding:8px 15px;background:#fbfbfb;border:solid #ddd;border-width:1px 1px 0;margin-left:-1px;height:22px;}
.admin_tab .admin_tab_firstli a{margin-left:0}
.admin_tab .current,.admin_tab a:hover{height:22px;border-bottom:1px solid  #fbfbfb;margin-bottom:-1px;position:relative;}
.admin_tab li{float:left;}
.admin_tab_content{border:1px solid #ddd;border-top-width:0;padding:10px;}
/*缩略图div*/
.div_show{float:left;background-color: #cccccc; width: 200px;height: 200px; border: 1px;display: inline-block; position: relative;}
.div_show img{ width: 200px;height: 200px;}
.div_show .delete{position: absolute;top: 0px; right: 0px;width: 40px; height: 40px;font-size: 36px;display:none;color:red;}
.edit_table td:nth-child(1){width:10%;}
.edit_table td{width:22%;}

.layui-layer-btn a {
    height: 28px;
    line-height: 28px;
    margin: 0 6px;
    padding: 0 15px;
    border: 1px solid #dedede;
    background-color: #f1f1f1;
    color: #333;
    border-radius: 2px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
}

.layui-layer-btn a:hover {
    opacity: 0.9;
    text-decoration: none;
}



</style>
<div class="page-container" onload="sf();">
    		<form action="${contextPath}/courses/course_review" method="post" id="form-student-add"  >
											<div id="main_content" class="fl">
							 <input type="hidden" value="${courses.id}" name="id" />
							<div class="order">
								<div class="filter">
									<div class="input_common">
										<ul>
											<li>
												<span id="ps">价格：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="">
													
												</label>
												
												<input class="input-text radius" style="width:250px" name="price"
													value="" type="text" id="price"   maxlength="25" />(单位‘元’)</span>
											</li>
										</ul>

									    <div style="text-align:center;padding-top:10px;">
									    
									    <input class="btn btn-success" type="button" value="提交" onclick="tianjiaxs()"  />
										<a class="layui-layer-btn" onclick="quxiao()">取消</a>  
									    </div>
									</div>
								</div>
							</div>
						</div>
	    </form>	
	    <iframe name="hidden_frame" style="display:none;"></iframe>
</div>
<@frame.end "default">
</@frame.end>
</html>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/select/jquery.searchableSelect.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/present/add_or_update_present.js"></script>
<script  type="text/javascript" >
var typeId="${product.typeId!'0'}";
var path="${contextPath}";
var shoufei="${shoufei}";
$(document).ready(function(){
  <#if imageList?? && imageList?size &gt; 0>
    <#list  imageList as image>
    <#if image?? >
       var img= $("#show_${image.sequences}").children("img");
       img.attr("src","${imagePath}/shop/product/${image.prodId}/${image.image}");
       img.attr("data-type","1");
     <#else>
       img.attr("src","${webSite}/admin/images/no_img.jpg");
       img.attr("data-type","0");
    </#if>
    </#list>
 </#if> 
 if(shoufei==2){
		document.getElementById("ps").style.display="block";
	}else{
		document.getElementById("ps").style.display="none";
	}
});
function callback(flag, message) {
	layer.closeAll('loading');
	if (flag == true) {
		layer.msg('操作成功!', {
			icon : 1,
			time : 1000
		}, function() {
			var index = parent.layer.getFrameIndex(window.name);
			parent.search();
			parent.layer.close(index);
		});
	} else {
		layer.alert(message);
	}
}
function callback2(flag, message) {
	layer.closeAll('loading');
	if (flag == true) {
		window.location = path + "/product/query_product";
	} else {
		layer.alert(message);
	}
}



function tianjiaxs(){
	var phoneNumber =$("#price").val();
	if(shoufei==2){
		
		if(phoneNumber.length==0 || phoneNumber==""){
			layer.alert("请输入价格！");
			window.orgAdmin.document.getElementById("phoneNumber").focus();
			return;
		}
		if(!(/(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/.test(phoneNumber))){
			layer.alert("请输入正确价格(小数不能超过两位)！");
			window.orgAdmin.document.getElementById("phoneNumber").focus();
			return;
		}
		
	}
	
    $("#form-student-add").ajaxSubmit({
		dataType : 'json',
        success: function(message){
        		if(message == "200"){
                    layer.msg('操作成功!',{icon:1,time:1000},function(){
                    	  parent.window.location.reload();
                    });
 				}else if(message == "201"){
 					 layer.msg('此账号已存在!',{icon:1,time:1000},function(){

 				})
 				}else if(message == "500"){
 					layer.alert("异常！");
 				}else if(message == "501"){
 					layer.alert("系统繁忙！");
 				}else{
 					layer.alert(message);
 				}
 				
        },
        error: function(){
            layer.msg('操作失败!',{icon:5,time:1000});
        },complete: function(XMLHttpRequest, textStatus) {
        	layer.close(layer_load_window);
        }
    });

}
function quxiao(){
	 parent.window.location.reload();
}

</script>